<template>
  <div class="icons-div">
    <textarea id="copyText" style="width: 0px;height: 0px;position:absolute;top:-100px"></textarea>
    <a-input-search placeholder="请输入图标名称" @search="onSearch" @onPressEnter="onSearch" enterButton="查询" size="large" />
    <ul class="anticons-list">
      <li v-for="iconKey in iconKeys" class="anticon anticon-step-backward" @click="copyLink(iconKey)">
        <a-icon :component="icons[iconKey]" style="font-size: 48px;"/>
        <span class="anticon-class">{{ iconKey }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
  import icons from '../icons/icons'
export default {
  data() {
    return {
      icons: icons,
      iconKeysAll: [],
      iconKeys: []
    }
  },
  name: 'Icon',
  props: {
    msg: String
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
